package com.ruoyi.activiti.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.activiti.domain.ActReModel;
import com.ruoyi.activiti.service.IActReModelService;

/**
 * 流程设计模型部署 提供者
 *
 * @author ruoyi
 * @date 2019-11-26
 */
@RestController
@RequestMapping("MODEL")
public class ActReModelController extends BaseController
{

	@Autowired
	private IActReModelService actReModelService;

	/**
	 * 查询${tableComment}
	 */
	@GetMapping("get/{id}")
	public ActReModel get(@PathVariable("id") String id)
	{
		return actReModelService.selectActReModelById(id);

	}

	/**
	 * 查询流程设计模型部署列表
	 */
	@GetMapping("list")
	public R list(ActReModel actReModel)
	{
		startPage();
        return result(actReModelService.selectActReModelList(actReModel));
	}


	/**
	 * 新增保存流程设计模型部署
	 */
	@PostMapping("save")
	public R addSave(@RequestBody ActReModel actReModel)
	{
		return toAjax(actReModelService.insertActReModel(actReModel));
	}

	/**
	 * 修改保存流程设计模型部署
	 */
	@PostMapping("update")
	public R editSave(@RequestBody ActReModel actReModel)
	{
		return toAjax(actReModelService.updateActReModel(actReModel));
	}

	/**
	 * 删除${tableComment}
	 */
	@PostMapping("remove")
	public R remove(String ids)
	{
		return toAjax(actReModelService.deleteActReModelByIds(ids));
	}

}
